<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>B::Deparse - Perl compiler backend to produce perl code - Perldoc Browser</title>
    <link rel="search" href="https://perldoc.perl.org/opensearch.xml" type="application/opensearchdescription+xml" title="Perldoc Browser">
    <link rel="canonical" href="https://perldoc.perl.org/B::Deparse">
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/styles/stackoverflow-light.min.css" integrity="sha512-cG1IdFxqipi3gqLmksLtuk13C+hBa57a6zpWxMeoY3Q9O6ooFxq50DayCdm0QrDgZjMUn23z/0PMZlgft7Yp5Q==" crossorigin="anonymous" />
    <style>
      body {
        background: #f4f4f5;
        color: #020202;
      }
      .navbar-dark {
        background-image: -webkit-linear-gradient(top, #005f85 0, #002e49 100%);
        background-image: -o-linear-gradient(top, #005f85 0, #002e49 100%);
        background-image: linear-gradient(to bottom, #005f85 0, #002e49 100%);
        filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff005f85', endColorstr='#ff002e49', GradientType=0);
        background-repeat: repeat-x;
      }
      .navbar-dark .navbar-nav .nav-link,
      .navbar-dark .navbar-nav .nav-link:focus { color: #fff }
      .navbar-dark .navbar-nav .nav-link:hover { color: #ffef68 }
      #wrapperlicious {
        margin: 0 auto;
        font: 0.9em 'Helvetica Neue', Helvetica, sans-serif;
        font-weight: normal;
        line-height: 1.5em;
        margin: 0;
        padding: 0;
      }
      #wrapperlicious h1 { font-size: 1.5em }
      #wrapperlicious h2 { font-size: 1.3em }
      #wrapperlicious h3 { font-size: 1.1em }
      #wrapperlicious h4 { font-size: 0.9em }
      #wrapperlicious h1, #wrapperlicious h2, #wrapperlicious h3,
      #wrapperlicious h4, #wrapperlicious dt {
        color: #020202;
        margin-top: 1em;
        margin-bottom: 1em;
        position: relative;
        font-weight: bold;
      }
      #wrapperlicious a { color: inherit; text-decoration: underline }
      #wrapperlicious #toc { text-decoration: none }
      #wrapperlicious a:hover { color: #2a2a2a }
      #wrapperlicious a img { border: 0 }
      #wrapperlicious :not(pre) > code {
        color: inherit;
        background-color: rgba(0, 0, 0, 0.04);
        border-radius: 3px;
        font: 0.9em Consolas, Menlo, Monaco, monospace;
        padding: 0.3em;
      }
      #wrapperlicious dd {
        margin: 0;
        margin-left: 2em;
      }
      #wrapperlicious dt {
        color: #2a2a2a;
        font-weight: bold;
        margin-left: 0.9em;
      }
      #wrapperlicious p {
        margin-bottom: 1em;
        margin-top: 1em;
      }
      #wrapperlicious li > p {
        margin-bottom: 0;
        margin-top: 0;
      }
      #wrapperlicious pre {
        border: 1px solid #c1c1c1;
        border-radius: 3px;
        font: 100% Consolas, Menlo, Monaco, monospace;
        margin-bottom: 1em;
        margin-top: 1em;
      }
      #wrapperlicious pre > code {
        display: block;
        background-color: #f6f6f6;
        font: 0.9em Consolas, Menlo, Monaco, monospace;
        line-height: 1.5em;
        text-align: left;
        white-space: pre;
        padding: 1em;
      }
      #wrapperlicious dl, #wrapperlicious ol, #wrapperlicious ul {
        margin-bottom: 1em;
        margin-top: 1em;
      }
      #wrapperlicious ul {
        list-style-type: square;
      }
      #wrapperlicious ul ul {
        margin-bottom: 0px;
        margin-top: 0px;
      }
      #footer {
        font-size: 0.8em;
        padding-top: 0.5em;
        text-align: center;
      }
      #more {
        display: inline;
        font-size: 0.8em;
      }
      #perldocdiv {
        background-color: #fff;
        border: 1px solid #c1c1c1;
        border-bottom-left-radius: 5px;
        border-bottom-right-radius: 5px;
        margin-left: auto;
        margin-right: auto;
        padding: 3em;
        padding-top: 1em;
        max-width: 960px;
      }
      #moduleversion { float: right }
      #wrapperlicious .leading-notice {
        font-style: italic;
        padding-left: 1em;
        margin-top: 1em;
        margin-bottom: 1em;
      }
      #wrapperlicious .permalink {
        display: none;
        left: -0.75em;
        position: absolute;
        padding-right: 0.25em;
        text-decoration: none;
      }
      #wrapperlicious h1:hover .permalink, #wrapperlicious h2:hover .permalink,
      #wrapperlicious h3:hover .permalink, #wrapperlicious h4:hover .permalink,
      #wrapperlicious dt:hover .permalink {
        display: block;
      }
    </style>
    <!-- Global site tag (gtag.js) - Google Analytics -->
    <script async src="https://www.googletagmanager.com/gtag/js?id=G-KVNWBNT5FB"></script>
    <script>
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());

      gtag('config', 'G-KVNWBNT5FB');
      gtag('config', 'UA-50555-3');
    </script>
  </head>
  <body>
    <nav class="navbar navbar-expand-md navbar-dark bg-dark justify-content-between">
  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
    <span class="navbar-toggler-icon"></span>
  </button>
  <a class="navbar-brand" href="https://perldoc.perl.org/">Perldoc Browser</a>
  <div class="collapse navbar-collapse" id="navbarNav">
    <ul class="navbar-nav mr-auto">
      <li class="nav-item dropdown text-nowrap">
        <a class="nav-link dropdown-toggle" href="./B::Deparse.html#" id="dropdownlink-stable" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">5.35.0</a>
        <div class="dropdown-menu" aria-labelledby="dropdownlink-stable">
          <a class="dropdown-item" href="https://perldoc.perl.org/B::Deparse">Latest</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.2/B::Deparse">5.38.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.1/B::Deparse">5.38.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.0/B::Deparse">5.38.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.36.3/B::Deparse">5.36.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.36.2/B::Deparse">5.36.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.36.1/B::Deparse">5.36.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.36.0/B::Deparse">5.36.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.34.3/B::Deparse">5.34.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.34.2/B::Deparse">5.34.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.34.1/B::Deparse">5.34.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.34.0/B::Deparse">5.34.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.32.1/B::Deparse">5.32.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.32.0/B::Deparse">5.32.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.30.3/B::Deparse">5.30.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.30.2/B::Deparse">5.30.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.30.1/B::Deparse">5.30.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.30.0/B::Deparse">5.30.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.28.3/B::Deparse">5.28.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.28.2/B::Deparse">5.28.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.28.1/B::Deparse">5.28.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.28.0/B::Deparse">5.28.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.26.3/B::Deparse">5.26.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.26.2/B::Deparse">5.26.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.26.1/B::Deparse">5.26.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.26.0/B::Deparse">5.26.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.4/B::Deparse">5.24.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.3/B::Deparse">5.24.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.2/B::Deparse">5.24.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.1/B::Deparse">5.24.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.0/B::Deparse">5.24.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.4/B::Deparse">5.22.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.3/B::Deparse">5.22.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.2/B::Deparse">5.22.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.1/B::Deparse">5.22.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.0/B::Deparse">5.22.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.20.3/B::Deparse">5.20.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.20.2/B::Deparse">5.20.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.20.1/B::Deparse">5.20.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.20.0/B::Deparse">5.20.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.4/B::Deparse">5.18.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.3/B::Deparse">5.18.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.2/B::Deparse">5.18.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.1/B::Deparse">5.18.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.0/B::Deparse">5.18.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.16.3/B::Deparse">5.16.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.16.2/B::Deparse">5.16.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.16.1/B::Deparse">5.16.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.16.0/B::Deparse">5.16.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.4/B::Deparse">5.14.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.3/B::Deparse">5.14.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.2/B::Deparse">5.14.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.1/B::Deparse">5.14.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.0/B::Deparse">5.14.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.5/B::Deparse">5.12.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.4/B::Deparse">5.12.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.3/B::Deparse">5.12.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.2/B::Deparse">5.12.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.1/B::Deparse">5.12.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.0/B::Deparse">5.12.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.10.1/B::Deparse">5.10.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.10.0/B::Deparse">5.10.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.9/B::Deparse">5.8.9</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.8/B::Deparse">5.8.8</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.7/B::Deparse">5.8.7</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.6/B::Deparse">5.8.6</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.5/B::Deparse">5.8.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.4/B::Deparse">5.8.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.3/B::Deparse">5.8.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.2/B::Deparse">5.8.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.1/B::Deparse">5.8.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.0/B::Deparse">5.8.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.6.2/B::Deparse">5.6.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.6.1/B::Deparse">5.6.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.6.0/B::Deparse">5.6.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005_04/B::Deparse">5.005_04</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005_03/B::Deparse">5.005_03</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005_02/B::Deparse">5.005_02</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005_01/B::Deparse">5.005_01</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005/B::Deparse">5.005</a>
        </div>
      </li>
      <li class="nav-item dropdown text-nowrap">
        <a class="nav-link dropdown-toggle" href="./B::Deparse.html#" id="dropdownlink-dev" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dev</a>
        <div class="dropdown-menu" aria-labelledby="dropdownlink-dev">
          <a class="dropdown-item" href="https://perldoc.perl.org/blead/B::Deparse">blead</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.6/B::Deparse">5.39.6</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.5/B::Deparse">5.39.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.4/B::Deparse">5.39.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.3/B::Deparse">5.39.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.2/B::Deparse">5.39.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.1/B::Deparse">5.39.1</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.0-RC2/B::Deparse">5.38.0-RC2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.0-RC1/B::Deparse">5.38.0-RC1</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.11/B::Deparse">5.37.11</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.10/B::Deparse">5.37.10</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.9/B::Deparse">5.37.9</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.8/B::Deparse">5.37.8</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.7/B::Deparse">5.37.7</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.6/B::Deparse">5.37.6</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.5/B::Deparse">5.37.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.4/B::Deparse">5.37.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.3/B::Deparse">5.37.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.2/B::Deparse">5.37.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.1/B::Deparse">5.37.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.0/B::Deparse">5.37.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.11/B::Deparse">5.35.11</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.10/B::Deparse">5.35.10</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.9/B::Deparse">5.35.9</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.8/B::Deparse">5.35.8</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.7/B::Deparse">5.35.7</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.6/B::Deparse">5.35.6</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.5/B::Deparse">5.35.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.4/B::Deparse">5.35.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.3/B::Deparse">5.35.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.2/B::Deparse">5.35.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.1/B::Deparse">5.35.1</a>
          <a class="dropdown-item active" href="./B::Deparse.html">5.35.0</a>
        </div>
      </li>
      <li class="nav-item dropdown text-nowrap">
        <a class="nav-link dropdown-toggle" href="./B::Deparse.html#" id="dropdownlink-nav" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Documentation</a>
        <div class="dropdown-menu" aria-labelledby="dropdownlink-nav">
          <a class="dropdown-item" href="perl.html">Perl</a>
          <a class="dropdown-item" href="perlintro.html">Intro</a>
          <a class="dropdown-item" href="perl.html#Tutorials">Tutorials</a>
          <a class="dropdown-item" href="perlfaq.html">FAQs</a>
          <a class="dropdown-item" href="perl.html#Reference-Manual">Reference</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="perlop.html">Operators</a>
          <a class="dropdown-item" href="functions.html">Functions</a>
          <a class="dropdown-item" href="variables.html">Variables</a>
          <a class="dropdown-item" href="modules.html">Modules</a>
          <a class="dropdown-item" href="perlutil.html">Utilities</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="perlcommunity.html">Community</a>
          <a class="dropdown-item" href="perlhist.html">History</a>
        </div>
      </li>
    </ul>
    <ul class="navbar-nav">
      <script>
        function set_expand (expand) {
          var perldocdiv = document.getElementById('perldocdiv');
          var width = window.getComputedStyle(perldocdiv).getPropertyValue('max-width');
          var expanded = (width == '' || width == 'none') ? true : false;
          if (expand === null) {
            expand = !expanded;
          }
          if ((expand && !expanded) || (!expand && expanded)) {
            perldocdiv.style.setProperty('max-width', expand ? 'none' : '960px');
            var button_classlist = document.getElementById('content-expand-button').classList;
            if (expand) {
              button_classlist.add('btn-light');
              button_classlist.remove('btn-outline-light');
            } else {
              button_classlist.add('btn-outline-light');
              button_classlist.remove('btn-light');
            }
          }
          return expand;
        }
        function toggle_expand () {
          var expand = set_expand(null);
          document.cookie = 'perldoc_expand=' + (expand ? 1 : 0) + '; path=/; expires=Tue, 19 Jan 2038 03:14:07 UTC';
        }
        function read_expand () {
          return document.cookie.split(';').some(function (item) { return item.indexOf('perldoc_expand=1') >= 0 });
        }
        if (document.readyState === 'loading') {
          document.addEventListener('DOMContentLoaded', function () {
            if (read_expand()) {
              set_expand(true);
            }
          });
        } else if (read_expand()) {
          set_expand(true);
        }
      </script>
      <button id="content-expand-button" type="button" class="btn btn-outline-light d-none d-lg-inline-block mr-2" onclick="toggle_expand()">Expand</button>
    <ul>
    <form class="form-inline" method="get" action="https://perldoc.perl.org/5.35.0/search">
      <input class="form-control mr-3" type="search" name="q" placeholder="Search" aria-label="Search">
    </form>
  </div>
</nav>

    <div id="wrapperlicious" class="container-fluid">
      <div id="perldocdiv">
        <div id="links">
          <a href="./B::Deparse.html">B::Deparse</a>
          <div id="more">
            (<a href="./B::Deparse.txt">source</a>,
            <a href="https://metacpan.org/pod/B::Deparse">CPAN</a>)
          </div>
            <div id="moduleversion">version 1.56</div>
        </div>
        <div class="leading-notice">
          You are viewing the version of this documentation from Perl 5.35.0.
            This is a development version of Perl.
        </div>
        <h1><a id="toc">CONTENTS</a></h1>
                  <ul>
              <li>
                <a class="text-decoration-none" href="./B::Deparse.html#NAME">NAME</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./B::Deparse.html#SYNOPSIS">SYNOPSIS</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./B::Deparse.html#DESCRIPTION">DESCRIPTION</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./B::Deparse.html#OPTIONS">OPTIONS</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./B::Deparse.html#USING-B::Deparse-AS-A-MODULE">USING B::Deparse AS A MODULE</a>
                            <ul>
              <li>
                <a class="text-decoration-none" href="./B::Deparse.html#Synopsis">Synopsis</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./B::Deparse.html#Description">Description</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./B::Deparse.html#new">new</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./B::Deparse.html#ambient_pragmas">ambient_pragmas</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./B::Deparse.html#coderef2text">coderef2text</a>
              </li>
          </ul>

              </li>
              <li>
                <a class="text-decoration-none" href="./B::Deparse.html#BUGS">BUGS</a>
              </li>
              <li>
                <a class="text-decoration-none" href="./B::Deparse.html#AUTHOR">AUTHOR</a>
              </li>
          </ul>

      <h1 id="NAME"><a class="permalink" href="./B::Deparse.html#NAME">#</a>NAME</h1>

<p>B::Deparse - Perl compiler backend to produce perl code</p>

<h1 id="SYNOPSIS"><a class="permalink" href="./B::Deparse.html#SYNOPSIS">#</a>SYNOPSIS</h1>

<p><b>perl</b> <b>-MO=Deparse</b>[<b>,-d</b>][<b>,-f</b><i>FILE</i>][<b>,-p</b>][<b>,-q</b>][<b>,-l</b>] [<b>,-s</b><i>LETTERS</i>][<b>,-x</b><i>LEVEL</i>] <i>prog.pl</i></p>

<h1 id="DESCRIPTION"><a class="permalink" href="./B::Deparse.html#DESCRIPTION">#</a>DESCRIPTION</h1>

<p>B::Deparse is a backend module for the Perl compiler that generates perl source code, based on the internal compiled structure that perl itself creates after parsing a program. The output of B::Deparse won&#39;t be exactly the same as the original source, since perl doesn&#39;t keep track of comments or whitespace, and there isn&#39;t a one-to-one correspondence between perl&#39;s syntactical constructions and their compiled form, but it will often be close. When you use the <b>-p</b> option, the output also includes parentheses even when they are not required by precedence, which can make it easy to see if perl is parsing your expressions the way you intended.</p>

<p>While B::Deparse goes to some lengths to try to figure out what your original program was doing, some parts of the language can still trip it up; it still fails even on some parts of Perl&#39;s own test suite. If you encounter a failure other than the most common ones described in the BUGS section below, you can help contribute to B::Deparse&#39;s ongoing development by submitting a bug report with a small example.</p>

<h1 id="OPTIONS"><a class="permalink" href="./B::Deparse.html#OPTIONS">#</a>OPTIONS</h1>

<p>As with all compiler backend options, these must follow directly after the &#39;-MO=Deparse&#39;, separated by a comma but not any white space.</p>

<dl>

<dt id="-d"><a class="permalink" href="./B::Deparse.html#-d">#</a><a id="d"></a><b>-d</b></dt>
<dd>

<p>Output data values (when they appear as constants) using Data::Dumper. Without this option, B::Deparse will use some simple routines of its own for the same purpose. Currently, Data::Dumper is better for some kinds of data (such as complex structures with sharing and self-reference) while the built-in routines are better for others (such as odd floating-point values).</p>

</dd>
<dt id="-fFILE"><a class="permalink" href="./B::Deparse.html#-fFILE">#</a><a id="fFILE"></a><b>-f</b><i>FILE</i></dt>
<dd>

<p>Normally, B::Deparse deparses the main code of a program, and all the subs defined in the same file. To include subs defined in other files, pass the <b>-f</b> option with the filename. You can pass the <b>-f</b> option several times, to include more than one secondary file. (Most of the time you don&#39;t want to use it at all.) You can also use this option to include subs which are defined in the scope of a <b>#line</b> directive with two parameters.</p>

</dd>
<dt id="-l"><a class="permalink" href="./B::Deparse.html#-l">#</a><a id="l"></a><b>-l</b></dt>
<dd>

<p>Add &#39;#line&#39; declarations to the output based on the line and file locations of the original code.</p>

</dd>
<dt id="-p"><a class="permalink" href="./B::Deparse.html#-p">#</a><a id="p"></a><b>-p</b></dt>
<dd>

<p>Print extra parentheses. Without this option, B::Deparse includes parentheses in its output only when they are needed, based on the structure of your program. With <b>-p</b>, it uses parentheses (almost) whenever they would be legal. This can be useful if you are used to LISP, or if you want to see how perl parses your input. If you say</p>

<pre><code>if ($var &amp; 0x7f == 65) {print &quot;Gimme an A!&quot;}
print ($which ? $a : $b), &quot;\n&quot;;
$name = $ENV{USER} or &quot;Bob&quot;;</code></pre>

<p><code>B::Deparse,-p</code> will print</p>

<pre><code>if (($var &amp; 0)) {
    print(&#39;Gimme an A!&#39;)
};
(print(($which ? $a : $b)), &#39;???&#39;);
(($name = $ENV{&#39;USER&#39;}) or &#39;???&#39;)</code></pre>

<p>which probably isn&#39;t what you intended (the <code>&#39;???&#39;</code> is a sign that perl optimized away a constant value).</p>

</dd>
<dt id="-P"><a class="permalink" href="./B::Deparse.html#-P">#</a><a id="P"></a><b>-P</b></dt>
<dd>

<p>Disable prototype checking. With this option, all function calls are deparsed as if no prototype was defined for them. In other words,</p>

<pre><code>perl -MO=Deparse,-P -e &#39;sub foo (\@) { 1 } foo @x&#39;</code></pre>

<p>will print</p>

<pre><code>    sub foo (\@) {
	1;
    }
    &amp;foo(\@x);</code></pre>

<p>making clear how the parameters are actually passed to <code>foo</code>.</p>

</dd>
<dt id="-q"><a class="permalink" href="./B::Deparse.html#-q">#</a><a id="q"></a><b>-q</b></dt>
<dd>

<p>Expand double-quoted strings into the corresponding combinations of concatenation, uc, ucfirst, lc, lcfirst, quotemeta, and join. For instance, print</p>

<pre><code>print &quot;Hello, $world, @ladies, \u$gentlemen\E, \u\L$me!&quot;;</code></pre>

<p>as</p>

<pre><code>print &#39;Hello, &#39; . $world . &#39;, &#39; . join($&quot;, @ladies) . &#39;, &#39;
      . ucfirst($gentlemen) . &#39;, &#39; . ucfirst(lc $me . &#39;!&#39;);</code></pre>

<p>Note that the expanded form represents the way perl handles such constructions internally -- this option actually turns off the reverse translation that B::Deparse usually does. On the other hand, note that <code>$x = &quot;$y&quot;</code> is not the same as <code>$x = $y</code>: the former makes the value of $y into a string before doing the assignment.</p>

</dd>
<dt id="-sLETTERS"><a class="permalink" href="./B::Deparse.html#-sLETTERS">#</a><a id="sLETTERS"></a><b>-s</b><i>LETTERS</i></dt>
<dd>

<p>Tweak the style of B::Deparse&#39;s output. The letters should follow directly after the &#39;s&#39;, with no space or punctuation. The following options are available:</p>

<dl>

<dt id="C"><a class="permalink" href="./B::Deparse.html#C">#</a><b>C</b></dt>
<dd>

<p>Cuddle <code>elsif</code>, <code>else</code>, and <code>continue</code> blocks. For example, print</p>

<pre><code>if (...) {
     ...
} else {
     ...
}</code></pre>

<p>instead of</p>

<pre><code>if (...) {
     ...
}
else {
     ...
}</code></pre>

<p>The default is not to cuddle.</p>

</dd>
<dt id="iNUMBER"><a class="permalink" href="./B::Deparse.html#iNUMBER">#</a><b>i</b><i>NUMBER</i></dt>
<dd>

<p>Indent lines by multiples of <i>NUMBER</i> columns. The default is 4 columns.</p>

</dd>
<dt id="T"><a class="permalink" href="./B::Deparse.html#T">#</a><b>T</b></dt>
<dd>

<p>Use tabs for each 8 columns of indent. The default is to use only spaces. For instance, if the style options are <b>-si4T</b>, a line that&#39;s indented 3 times will be preceded by one tab and four spaces; if the options were <b>-si8T</b>, the same line would be preceded by three tabs.</p>

</dd>
<dt id="vSTRING."><a class="permalink" href="./B::Deparse.html#vSTRING.">#</a><a id="vSTRING"></a><b>v</b><i>STRING</i><b>.</b></dt>
<dd>

<p>Print <i>STRING</i> for the value of a constant that can&#39;t be determined because it was optimized away (mnemonic: this happens when a constant is used in <b>v</b>oid context). The end of the string is marked by a period. The string should be a valid perl expression, generally a constant. Note that unless it&#39;s a number, it probably needs to be quoted, and on a command line quotes need to be protected from the shell. Some conventional values include 0, 1, 42, &#39;&#39;, &#39;foo&#39;, and &#39;Useless use of constant omitted&#39; (which may need to be <b>-sv&quot;&#39;Useless use of constant omitted&#39;.&quot;</b> or something similar depending on your shell). The default is &#39;???&#39;. If you&#39;re using B::Deparse on a module or other file that&#39;s require&#39;d, you shouldn&#39;t use a value that evaluates to false, since the customary true constant at the end of a module will be in void context when the file is compiled as a main program.</p>

</dd>
</dl>

</dd>
<dt id="-xLEVEL"><a class="permalink" href="./B::Deparse.html#-xLEVEL">#</a><a id="xLEVEL"></a><b>-x</b><i>LEVEL</i></dt>
<dd>

<p>Expand conventional syntax constructions into equivalent ones that expose their internal operation. <i>LEVEL</i> should be a digit, with higher values meaning more expansion. As with <b>-q</b>, this actually involves turning off special cases in B::Deparse&#39;s normal operations.</p>

<p>If <i>LEVEL</i> is at least 3, <code>for</code> loops will be translated into equivalent while loops with continue blocks; for instance</p>

<pre><code>for ($i = 0; $i &lt; 10; ++$i) {
    print $i;
}</code></pre>

<p>turns into</p>

<pre><code>$i = 0;
while ($i &lt; 10) {
    print $i;
} continue {
    ++$i
}</code></pre>

<p>Note that in a few cases this translation can&#39;t be perfectly carried back into the source code -- if the loop&#39;s initializer declares a my variable, for instance, it won&#39;t have the correct scope outside of the loop.</p>

<p>If <i>LEVEL</i> is at least 5, <code>use</code> declarations will be translated into <code>BEGIN</code> blocks containing calls to <code>require</code> and <code>import</code>; for instance,</p>

<pre><code>use strict &#39;refs&#39;;</code></pre>

<p>turns into</p>

<pre><code>sub BEGIN {
    require strict;
    do {
        &#39;strict&#39;-&gt;import(&#39;refs&#39;)
    };
}</code></pre>

<p>If <i>LEVEL</i> is at least 7, <code>if</code> statements will be translated into equivalent expressions using <code>&amp;&amp;</code>, <code>?:</code> and <code>do {}</code>; for instance</p>

<pre><code>print &#39;hi&#39; if $nice;
if ($nice) {
    print &#39;hi&#39;;
}
if ($nice) {
    print &#39;hi&#39;;
} else {
    print &#39;bye&#39;;
}</code></pre>

<p>turns into</p>

<pre><code>$nice and print &#39;hi&#39;;
$nice and do { print &#39;hi&#39; };
$nice ? do { print &#39;hi&#39; } : do { print &#39;bye&#39; };</code></pre>

<p>Long sequences of elsifs will turn into nested ternary operators, which B::Deparse doesn&#39;t know how to indent nicely.</p>

</dd>
</dl>

<h1 id="USING-B::Deparse-AS-A-MODULE"><a class="permalink" href="./B::Deparse.html#USING-B::Deparse-AS-A-MODULE">#</a><a id="USING"></a>USING B::Deparse AS A MODULE</h1>

<h2 id="Synopsis"><a class="permalink" href="./B::Deparse.html#Synopsis">#</a>Synopsis</h2>

<pre><code>use B::Deparse;
$deparse = B::Deparse-&gt;new(&quot;-p&quot;, &quot;-sC&quot;);
$body = $deparse-&gt;coderef2text(\&amp;func);
eval &quot;sub func $body&quot;; # the inverse operation</code></pre>

<h2 id="Description"><a class="permalink" href="./B::Deparse.html#Description">#</a>Description</h2>

<p>B::Deparse can also be used on a sub-by-sub basis from other perl programs.</p>

<h2 id="new"><a class="permalink" href="./B::Deparse.html#new">#</a>new</h2>

<pre><code>$deparse = B::Deparse-&gt;new(OPTIONS)</code></pre>

<p>Create an object to store the state of a deparsing operation and any options. The options are the same as those that can be given on the command line (see <a href="./B::Deparse.html#OPTIONS">&quot;OPTIONS&quot;</a>); options that are separated by commas after <b>-MO=Deparse</b> should be given as separate strings.</p>

<h2 id="ambient_pragmas"><a class="permalink" href="./B::Deparse.html#ambient_pragmas">#</a>ambient_pragmas</h2>

<pre><code>$deparse-&gt;ambient_pragmas(strict =&gt; &#39;all&#39;, &#39;$[&#39; =&gt; $[);</code></pre>

<p>The compilation of a subroutine can be affected by a few compiler directives, <b>pragmas</b>. These are:</p>

<ul>

<li><p>use strict;</p>

</li>
<li><p>use warnings;</p>

</li>
<li><p>Assigning to the special variable $[</p>

</li>
<li><p>use integer;</p>

</li>
<li><p>use bytes;</p>

</li>
<li><p>use utf8;</p>

</li>
<li><p>use re;</p>

</li>
</ul>

<p>Ordinarily, if you use B::Deparse on a subroutine which has been compiled in the presence of one or more of these pragmas, the output will include statements to turn on the appropriate directives. So if you then compile the code returned by coderef2text, it will behave the same way as the subroutine which you deparsed.</p>

<p>However, you may know that you intend to use the results in a particular context, where some pragmas are already in scope. In this case, you use the <b>ambient_pragmas</b> method to describe the assumptions you wish to make.</p>

<p>Not all of the options currently have any useful effect. See <a href="./B::Deparse.html#BUGS">&quot;BUGS&quot;</a> for more details.</p>

<p>The parameters it accepts are:</p>

<dl>

<dt id="strict"><a class="permalink" href="./B::Deparse.html#strict">#</a>strict</dt>
<dd>

<p>Takes a string, possibly containing several values separated by whitespace. The special values &quot;all&quot; and &quot;none&quot; mean what you&#39;d expect.</p>

<pre><code>$deparse-&gt;ambient_pragmas(strict =&gt; &#39;subs refs&#39;);</code></pre>

</dd>
<dt id="$["><a class="permalink" href="./B::Deparse.html#$%5B">#</a><a id="pod"></a>$[</dt>
<dd>

<p>Takes a number, the value of the array base $[. Obsolete: cannot be non-zero.</p>

</dd>
<dt id="bytes"><a class="permalink" href="./B::Deparse.html#bytes">#</a>bytes</dt>
<dd>

</dd>
<dt id="utf8"><a class="permalink" href="./B::Deparse.html#utf8">#</a>utf8</dt>
<dd>

</dd>
<dt id="integer"><a class="permalink" href="./B::Deparse.html#integer">#</a>integer</dt>
<dd>

<p>If the value is true, then the appropriate pragma is assumed to be in the ambient scope, otherwise not.</p>

</dd>
<dt id="re"><a class="permalink" href="./B::Deparse.html#re">#</a>re</dt>
<dd>

<p>Takes a string, possibly containing a whitespace-separated list of values. The values &quot;all&quot; and &quot;none&quot; are special. It&#39;s also permissible to pass an array reference here.</p>

<pre><code>$deparser-&gt;ambient_pragmas(re =&gt; &#39;eval&#39;);</code></pre>

</dd>
<dt id="warnings"><a class="permalink" href="./B::Deparse.html#warnings">#</a>warnings</dt>
<dd>

<p>Takes a string, possibly containing a whitespace-separated list of values. The values &quot;all&quot; and &quot;none&quot; are special, again. It&#39;s also permissible to pass an array reference here.</p>

<pre><code>$deparser-&gt;ambient_pragmas(warnings =&gt; [qw[void io]]);</code></pre>

<p>If one of the values is the string &quot;FATAL&quot;, then all the warnings in that list will be considered fatal, just as with the <b>warnings</b> pragma itself. Should you need to specify that some warnings are fatal, and others are merely enabled, you can pass the <b>warnings</b> parameter twice:</p>

<pre><code>    $deparser-&gt;ambient_pragmas(
	warnings =&gt; &#39;all&#39;,
	warnings =&gt; [FATAL =&gt; qw/void io/],
    );</code></pre>

<p>See <a href="warnings.html">warnings</a> for more information about lexical warnings.</p>

</dd>
<dt id="hint_bits"><a class="permalink" href="./B::Deparse.html#hint_bits">#</a>hint_bits</dt>
<dd>

</dd>
<dt id="warning_bits"><a class="permalink" href="./B::Deparse.html#warning_bits">#</a>warning_bits</dt>
<dd>

<p>These two parameters are used to specify the ambient pragmas in the format used by the special variables $^H and ${^WARNING_BITS}.</p>

<p>They exist principally so that you can write code like:</p>

<pre><code>    { my ($hint_bits, $warning_bits);
    BEGIN {($hint_bits, $warning_bits) = ($^H, ${^WARNING_BITS})}
    $deparser-&gt;ambient_pragmas (
	hint_bits    =&gt; $hint_bits,
	warning_bits =&gt; $warning_bits,
	&#39;$[&#39;         =&gt; 0 + $[
    ); }</code></pre>

<p>which specifies that the ambient pragmas are exactly those which are in scope at the point of calling.</p>

</dd>
<dt id="%^H"><a class="permalink" href="./B::Deparse.html#%25%5EH">#</a><a id="H"></a>%^H</dt>
<dd>

<p>This parameter is used to specify the ambient pragmas which are stored in the special hash %^H.</p>

</dd>
</dl>

<h2 id="coderef2text"><a class="permalink" href="./B::Deparse.html#coderef2text">#</a>coderef2text</h2>

<pre><code>$body = $deparse-&gt;coderef2text(\&amp;func)
$body = $deparse-&gt;coderef2text(sub ($$) { ... })</code></pre>

<p>Return source code for the body of a subroutine (a block, optionally preceded by a prototype in parens), given a reference to the sub. Because a subroutine can have no names, or more than one name, this method doesn&#39;t return a complete subroutine definition -- if you want to eval the result, you should prepend &quot;sub subname &quot;, or &quot;sub &quot; for an anonymous function constructor. Unless the sub was defined in the main:: package, the code will include a package declaration.</p>

<h1 id="BUGS"><a class="permalink" href="./B::Deparse.html#BUGS">#</a>BUGS</h1>

<ul>

<li><p>The only pragmas to be completely supported are: <code>use warnings</code>, <code>use strict</code>, <code>use bytes</code>, <code>use integer</code> and <code>use feature</code>.</p>

<p>Excepting those listed above, we&#39;re currently unable to guarantee that B::Deparse will produce a pragma at the correct point in the program. (Specifically, pragmas at the beginning of a block often appear right before the start of the block instead.) Since the effects of pragmas are often lexically scoped, this can mean that the pragma holds sway over a different portion of the program than in the input file.</p>

</li>
<li><p>In fact, the above is a specific instance of a more general problem: we can&#39;t guarantee to produce BEGIN blocks or <code>use</code> declarations in exactly the right place. So if you use a module which affects compilation (such as by over-riding keywords, overloading constants or whatever) then the output code might not work as intended.</p>

</li>
<li><p>Some constants don&#39;t print correctly either with or without <b>-d</b>. For instance, neither B::Deparse nor Data::Dumper know how to print dual-valued scalars correctly, as in:</p>

<pre><code>use constant E2BIG =&gt; ($!=7); $y = E2BIG; print $y, 0+$y;

use constant H =&gt; { &quot;#&quot; =&gt; 1 }; H-&gt;{&quot;#&quot;};</code></pre>

</li>
<li><p>An input file that uses source filtering probably won&#39;t be deparsed into runnable code, because it will still include the <b>use</b> declaration for the source filtering module, even though the code that is produced is already ordinary Perl which shouldn&#39;t be filtered again.</p>

</li>
<li><p>Optimized-away statements are rendered as &#39;???&#39;. This includes statements that have a compile-time side-effect, such as the obscure</p>

<pre><code>my $x if 0;</code></pre>

<p>which is not, consequently, deparsed correctly.</p>

<pre><code>  foreach my $i (@_) { 0 }
=&gt;
  foreach my $i (@_) { &#39;???&#39; }</code></pre>

</li>
<li><p>Lexical (my) variables declared in scopes external to a subroutine appear in coderef2text output text as package variables. This is a tricky problem, as perl has no native facility for referring to a lexical variable defined within a different scope, although <a href="PadWalker.html">PadWalker</a> is a good start.</p>

<p>See also <a href="./Data::Dump::Streamer.html">Data::Dump::Streamer</a>, which combines B::Deparse and <a href="PadWalker.html">PadWalker</a> to serialize closures properly.</p>

</li>
<li><p>There are probably many more bugs on non-ASCII platforms (EBCDIC).</p>

</li>
</ul>

<h1 id="AUTHOR"><a class="permalink" href="./B::Deparse.html#AUTHOR">#</a>AUTHOR</h1>

<p>Stephen McCamant &lt;smcc@CSUA.Berkeley.EDU&gt;, based on an earlier version by Malcolm Beattie &lt;mbeattie@sable.ox.ac.uk&gt;, with contributions from Gisle Aas, James Duncan, Albert Dvornik, Robin Houston, Dave Mitchell, Hugo van der Sanden, Gurusamy Sarathy, Nick Ing-Simmons, and Rafael Garcia-Suarez.</p>


      </div>
      <div id="footer">
        <p>Perldoc Browser is maintained by Dan Book (<a href="https://metacpan.org/author/DBOOK">DBOOK</a>). Please contact him via the <a href="https://github.com/Grinnz/perldoc-browser/issues">GitHub issue tracker</a> or <a href="mailto:dbook@cpan.org">email</a> regarding any issues with the site itself, search, or rendering of documentation.</p>

<p>The Perl documentation is maintained by the Perl 5 Porters in the development of Perl. Please contact them via the <a href="https://github.com/Perl/perl5/issues">Perl issue tracker</a>, the <a href="https://lists.perl.org/list/perl5-porters.html">mailing list</a>, or <a href="https://kiwiirc.com/client/irc.perl.org/p5p">IRC</a> to report any issues with the contents or format of the documentation.</p>


      </div>
    </div>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.slim.min.js" integrity="sha512-/DXTXr6nQodMUiq+IUJYCt2PPOUjrHJ9wFrqpJ3XkgPNOZVfMok7cRw6CSxyCQxXn6ozlESsSh1/sMCTF1rL/g==" crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.1/umd/popper.min.js" integrity="sha512-ubuT8Z88WxezgSqf3RLuNi5lmjstiJcyezx34yIU2gAHonIi27Na7atqzUZCOoY4CExaoFumzOsFQ2Ch+I/HCw==" crossorigin="anonymous"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script>
    <script src="../highlight.pack.js"></script>
    <script>hljs.highlightAll();</script>
  </body>
</html>
